<template>
<div>
  <span>x:</span>
  <input type="number" v-model="x" class="numbers">
  <span>y:</span>
  <input type="number" v-model="y" class="numbers">
  <button @click="start">新游戏</button>
  <div id="fantuG">
  </div>
</div>
</template>

<script>
  import Fantu from './fantu'
  export default {
    name: "Fantu",
    data(){
      return {
        x:6,
        y:6,
      }
    },
    methods:{
      start(){
        let obj=document.getElementById("fantuG");
        obj.innerHTML=null;
        new Fantu(obj,this.x,this.y);
      }
    },
    mounted() {
      this.start();
    }
  }
</script>

<style scoped>
.numbers{
  width: 50px;
}
</style>
